<div>群号：<span class="code">--</span></div>
<div>名称：<span class="name">--</span></div>
<div>头像：</div>
<div>成员数量：<span class="count">--</span></div>
<div>游戏：<span class="game">无</span></div>

<script>
    var timer = setInterval(function() {
        if (isEmpty(currGroup)) return;
        clearInterval(timer);
        
        // 拉取群成员列表
        get_members(currGroup.id, function(list) {
            currGroup.list = list;
            fill_group_info(currGroup);
        });
    }, 500);

    // 取得群成员列表
    function get_members(id, cb) {
        $.ajax({
            url: get_url("group/member/query-by-group"),
            type: "POST",
            dataType: "json",
            data: {
                group: id,
            },
            success: function(r) {
                console.log("得到群成员列表：", r);
                if (r.code == 0)
                    cb(r.data);
                else
                    cb([]);
            }
        });
    }

    // 填充群数据
    function fill_group_info(data) {
        $(".code").html(data.code);
        $(".name").html(data.name);
        $(".count").html(data.list.length);
        $(".game").html(data.lottery ? get_game_display_name(data.lottery) : "无");
    }
</script>
   